<?php

use yii\helpers\Html;
use yii\widgets\ActiveForm;
use yii\helpers\ArrayHelper;

/* @var $this yii\web\View */
/* @var $model app\models\GkyWeReplyText */
/* @var $form yii\widgets\ActiveForm */
?>

<div class="gky-we-reply-text-form">
<div class="panel panel-default">
        <!--<div class="panel-heading text-center" style="background: #003eff;color:white">gky-we-welcome</div>-->
        <div class="panel-body">
    <?php $form = ActiveForm::begin(); ?>
            
    <div class="col-lg-4 col-xs-12 col-sm-4 col-md-4">
    <?= $form->field($model, 'keyword')->textInput(['maxlength' => true]) ?>
    </div>
    <div class="col-lg-4 col-xs-12 col-sm-4 col-md-4">
    <?php
    $types = [
        ['key'=>0,'value'=>'精确匹配'],
        ['key'=>1,'value'=>'模糊匹配'],
    ];
    echo $form->field($model, 'keyword_type')
        ->dropDownList(
            ArrayHelper::map($types,'key','value')
        )
        ->label('匹配类型')
    ?>
    </div>
    <div class="col-lg-4 col-xs-12 col-sm-4 col-md-4"">
    <?= $form->field($model, 'sort')
        ->dropDownList(
            [1,2,3,4,5],
            ['prompt' => '请选择优先级'])
        ->label('优先级 （数值越小越先匹配）')
    ?>
    </div>
    <div class="col-lg-4 col-xs-12 col-sm-4 col-md-4">
    <?php
    $accounts = \app\models\GkyWeAccount::find()->all();
    echo $form->field($model, 'weoid')
        ->dropDownList(
            ArrayHelper::map($accounts,'weoid','wename'),
            ['prompt' => '请选择公众号']
        )
        ->label('公众号')
    ?>
    </div>
    <div class="col-lg-12 col-xs-12 col-sm-12 col-md-12">
         <?= $form->field($model, 'content')->textarea(['rows' => 6]) ?>
    </div>
   

    <div class="form-group text-center col-lg-12 col-xs-12 col-sm-12 col-md-12">
        <?= Html::submitButton($model->isNewRecord ? '新增' : '更新', ['class' => $model->isNewRecord ? 'btn btn-success' : 'btn btn-primary']) ?>
        <?= Html::a('返回', ['index'], ['class' => 'btn btn-primary']) ?>
    </div>

    <?php ActiveForm::end(); ?>
        </div>
</div>
</div>
